import * as THREE from 'three'

const geometry = new THREE.BufferGeometry()

// const vertices = new Float32Array([0, 0, 0, 100, 0, 0, 0, 100, 0, 0, 0, 10, 0, 0, 100, 100, 0, 10])
const vertices = new Float32Array([
  0, 0, 0, 100, 0, 0, 0, 100, 0,
  // 0, 100, 0,
  // 100, 0, 0,
  100, 100, 0
])

const attributes = new THREE.BufferAttribute(vertices, 3) // 3 表示每个顶点有3个坐标
geometry.attributes.position = attributes

const indices = new Uint16Array([0, 1, 2, 2, 1, 3])
geometry.index = new THREE.BufferAttribute(indices, 1) // 1 表示每个索引有1个值

const material = new THREE.MeshBasicMaterial({ color: new THREE.Color('orange'), wireframe: true })

const mesh = new THREE.Mesh(geometry, material)

export default mesh
